//
//  SIWebViewController.swift
//  SinaImiate
//
//  Created by xiaoming on 16/7/11.
//  Copyright © 2016年 GoodJob. All rights reserved.
//

import UIKit

class SIWebViewController: SIBaseViewController {

    private lazy var webView = UIWebView(frame: UIScreen.main().bounds)
    
    var urlString: String? {
        didSet {
            
            guard let urlString = urlString,
                url = URL(string: urlString)
                else {
                return
            }
            
            webView.loadRequest(URLRequest(url: url))
            
        }
        
    }
    
    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
    }

}

extension SIWebViewController {
    
    override func setupTableView() {
        
        navItem.title = "网页"
        
        view.insertSubview(webView, belowSubview: navigationBar)
        
        webView.backgroundColor = UIColor.white()
        
        webView.scrollView.contentInset.top = navigationBar.bounds.height
    }
    
}
